package cn.zmlio.akkastudy.scala.hello

import akka.actor.{Actor, ActorSystem, Props}

/**
  * @author : zml
  * @since : 1.0 
  * @version : 1.0
  *          Description : 
  *          Created in: 2018/4/20 上午9:21
  *          Modified By: 
  */
class HelloAkka extends Actor {
  def props: Props = Props[HelloAkka]

  override def receive: Receive = {
    case msg: String => print(msg)
    case _ => sender() ! "Wrong Type"
  }
}

object Hello extends App {
  val actorSystem = ActorSystem.create("HelloAkka")
  val actorRef = actorSystem.actorOf(Props[HelloAkka])
  actorRef ! "Hello Akka"
  actorSystem.terminate()
}